//
// CTrackSampledQuat.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CTrackSampledQuat extends CTrackSampledCommon {
  private long swigCPtr;

  public CTrackSampledQuat(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CTrackSampledQuat_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTrackSampledQuat obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTrackSampledQuat(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CTrackSampledQuat() {
    this(nel3dJNI.new_CTrackSampledQuat(), true);
  }

  public IAnimatedValue eval(float date, CAnimatedValueBlock avBlock) {
    return new IAnimatedValue(nel3dJNI.CTrackSampledQuat_eval(swigCPtr, this, date, CAnimatedValueBlock.getCPtr(avBlock), avBlock), false);
  }

  public void serial(IStream f) {
    nel3dJNI.CTrackSampledQuat_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void applySampleDivisor(long sampleDivisor) {
    nel3dJNI.CTrackSampledQuat_applySampleDivisor(swigCPtr, this, sampleDivisor);
  }

  public void build(Vector_uint16 timeList, SWIGTYPE_p_std__vectorT_NLMISC__CQuat_t keyList, float beginTime, float endTime) {
    nel3dJNI.CTrackSampledQuat_build(swigCPtr, this, Vector_uint16.getCPtr(timeList), timeList, SWIGTYPE_p_std__vectorT_NLMISC__CQuat_t.getCPtr(keyList), beginTime, endTime);
  }

  public boolean applyTrackQuatHeaderCompressionPass0(CTrackSampleCounter quatCounter) {
    return nel3dJNI.CTrackSampledQuat_applyTrackQuatHeaderCompressionPass0(swigCPtr, this, CTrackSampleCounter.getCPtr(quatCounter), quatCounter);
  }

  public ITrack applyTrackQuatHeaderCompressionPass1(SWIGTYPE_p_unsigned_int globalKeyOffset, CTrackSamplePack quatPacker) {
    long cPtr = nel3dJNI.CTrackSampledQuat_applyTrackQuatHeaderCompressionPass1(swigCPtr, this, SWIGTYPE_p_unsigned_int.getCPtr(globalKeyOffset), CTrackSamplePack.getCPtr(quatPacker), quatPacker);
    return (cPtr == 0) ? null : new ITrack(cPtr, false);
  }

}
